{% extends "admin/change_form.html" %}
{% load i18n admin_urls admin_static admin_modify %}

{% block extrahead %}{{ block.super }}
  {{ form.media.css }}
{% endblock %}

{% block content %}
  {{ block.super }}
  <script type="text/javascript">
    (function ($) {
      $(document).ready(function ($) {
        $("th").css("white-space", "nowrap");
        $(".btn-group-lg").empty();
        var divs = $(".col-lg-4 div[class='input-group']");
        divs.find("select.django-select2").hide();
        divs.css("width", "100%");
        divs.find("span.select2").css("width", "100%");
        $(".input-group-btn").hide();
        {#$(".inline-group thead tr").insert('<th></th>');#}
        $(".inline-group .original p").hide();

        {% if not is_popup %}
          $(".btn-group-lg").append('<input type="submit" name="_back" class="btn btn-high btn-default" value="返回" />');
          $(":submit[name='_back']").click(function () {
            history.back();
            return false;
          });
        {% else %}
          $(".btn-group-lg").append('<input type="submit" name="_close" class="btn btn-high btn-default" value="关闭" />');
          $(":submit[name='_close']").click(function () {
            window.close();
            return false;
          });
        {% endif %}
        {% if add or has_change %}$(".btn-group-lg").append('<input type="submit" name="_save" class="default btn btn-primary" value="确定" />');{% endif %}
      });
    }(jQuery || django.jQuery));
  </script>
  {{ form.media.js }}
{% endblock %}
